/*
 * KeyDef.java
 * Created on August 10, 2008, 1:02 AM by Uru
 *
 * Contains information about the actions taken at a particular node after a given keystroke
 */

package MenuSystem;

public class KeyDef {
    public String command;          //a Lua command to be executed, null = no command
    public ControlNode nextNode;    //the node to go to next, null = stay here
    public boolean pop;             //should this menu be popped off the stack?
    public String nextMenu;         //the name of the menu to go to next, null = stay here
    //pop = true and nextMenu = null, pop and return to previous menu
    //pop = true and nextMenu != null, replace current menu with new one
    //pop = false and nextMenu != null, push new menu onto stack
    //pop = false and nextMenu = null, stay at this menu
    
    //Creates a new instance of KeyDef
    public KeyDef(){
        command = null;
        nextNode = null;
        pop = false;
        nextMenu = null;
    }
    
    //full constructor, defines all elements
    public KeyDef(ControlNode n, String com, String menuname, boolean remove){
        command = com;
        nextNode = n;
        nextMenu = menuname;
        pop = remove;
    }
    
    //full non-menu-changing constructor
    public KeyDef(ControlNode n, String com){
        command = com;
        nextNode = n;
        nextMenu = null;
        pop = false;
    }
    
    //Creates a new instance of KeyDef
    public KeyDef(String com){
        command = com;
        nextNode = null;
        nextMenu = null;
        pop = false;
    }
    
    //Creates a new instance of KeyDef
    public KeyDef(ControlNode n){
        command = null;
        nextNode = n;
        nextMenu = null;
        pop = false;
    }
    
}
